/*
 * Created by Jaren at 2021/10/29 14:05
 */

import 'package:binary/binary.dart';
import 'package:inmotion_protocol/base/vehicle_data.dart';
import 'package:inmotion_protocol/common/product_model.dart';
import 'package:inmotion_protocol/common/product_version.dart';
import 'package:inmotion_protocol/lorin/bean/base/base.dart';

abstract class AbsSettings extends Base<AbsSettings> with Settings {
  AbsSettings(ProductModel model, VersionWrapper version) : super(model, version);

  static bool isStateOn(Int8 state) {
    return state.value == 1;
  }

  static Int8 getState(bool state) {
    return state ? Int8(1) : Int8(0);
  }

  @override
  int length() {
    return compact!.length();
  }
}
